{if $mode == "add"}

    <p>You can create a page here.  This uses 
       <strong><a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a></strong>.</p>

    <form method="post" action="{$SITEROOT}/custom_page.php?mode=add&access={$access}">
        <input type="hidden" name="posted" value="1" />

        Link name: <input type="text" name="linkname" value="{$page->linkname}" /> (shows in left box)<br />
        Long name: <input type="text" name="longname" value="{$page->longname}" /> (shows as page title)<br />
        <textarea rows="30" cols="80" name="content">{$page->content}</textarea><br />
        <input type="submit" value="Create Page" />
    </form>

{elseif $mode == "delete"}

    <p>Are you sure you want to delete this page?  If so, click the button below.</p>

    <form method="post" action="{$SITEROOT}/custom_page.php?mode=delete&pgid={$page->pgid}">
        <input type="hidden" name="posted" value="1" />
        <input type="submit" value="Delete Page" />
    </form>

{elseif $mode == "edit"}

    <p>You can edit the page here.  This uses 
       <strong><a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a></strong>.</p>

    <form method="post" action="{$SITEROOT}/custom_page.php?mode=edit&pgid={$page->pgid}">
        <input type="hidden" name="posted" value="1" />
        Link name: <input type="text" name="linkname" value="{$page->linkname}" /> (shows in left box)<br />
        Long name: <input type="text" name="longname" value="{$page->longname}" /> (shows as page title)<br />
        <textarea rows="30" cols="80" name="content">{$page->content}</textarea><br />
        <input type="submit" value="Save Changes" />
    </form>

{/if}
